<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: LV
  Date: 2016/7/14
  Time: 19:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%--<meta charset="UTF-8">--%>
    <%--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">--%>
    <%--<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>--%>
    <%--<!-- 全屏 -->--%>
    <%--<meta name="apple-mobile-web-app-capable" content="yes"/>--%>
    <%--<!-- 上方栏显示 -->--%>
    <%--<meta name="apple-mobile-web-app-status-bar-style" content="black"/>--%>
    <%--<!-- 不自动识别号码 -->--%>
    <%--<meta name="format-detection" content="telephone=no">--%>
    <%--<link href="${ctx}/assets/public_skin/css/reset.css" rel="stylesheet">--%>
    <%--<link href="${ctx}/assets/public_skin/css/shop_style.css" rel="stylesheet">--%>
    <%--<script src="${ctx}/assets/public_skin/js/jquery-1.11.1.min.js" type="text/javascript"></script>--%>
    <%--<script src="${ctx}/assets/public_skin/js/shop.common.js" type="text/javascript"></script>--%>
    <%--<script src="${ctx}/assets/public_skin/js/jquery.touchSlider.js " type="text/javascript"></script>--%>
    <script>
        //方法启用
        $(function () {
            $.Dashenslider(".main_visual", ".main_image", ".flicking_con a", "#btn_prev", "#btn_next", "on", 5000);//首页幻灯片
            $.Dashentab(".tab_menu .mt", "span", ".tab_menu .mc", ".item", "curr", "click", 0);
        })
    </script>
    <script>
        $(function () {
            var productId = $("#productId").val();
            $("#add_cart").bind("click", function () {
                //alert(shopId+"---"+productId);
                $.post("${ctx}/shopping/addGoodsToCart", {"pid": productId}, function (json) {
                    if (json.status != null && json.status != undefined) {
                        switch (json.status) {
                            case "s0":
                                alert("添加失败");
                                break;
                            case "s1":
                            {
                                alert("添加成功");
                                var num = $("#p_num").text();
                                if (num != "" && num != undefined) {
                                    var mnum = parseInt(num);
                                    $("#p_num").text(mnum + 1);
                                } else {
                                    $("#p_num").text(1);
                                }
                            }
                                break;
                            case "s2":
                                alert("添加成功，添加了相同的商品");
                                break;
                        }
                    }
                    if (json.url != null && json.url != undefined)
                        window.location.href = "${ctx}/" + json.url;
                }, "json")
            })
        });
    </script>
    <title>商品详情</title>
</head>
<body>
<%--<header>--%>
<%--<a href="javascript:;"></a>--%>
<%--<h1 class="new_logo">商品详情</h1>--%>
<%--</header>--%>
<article class="viewports">
    <div class="product_details">
        <!--star 产品幻灯片-->
        <div class="main_visual">
            <div class="flicking_con">
                <a href="#"></a>
                <a href="#"></a>
                <a href="#"></a>
                <a href="#"></a>
            </div>
            <div class="main_image">
                <ul>
                    <c:forEach items="${imgs}" var="img">
                        <li><a href="javascript:;"><span style="background-image:url(${img});"></span></a></li>
                    </c:forEach>
                </ul>
                <a href="javascript:;" class="slide-btn" id="btn_prev"></a>
                <a href="javascript:;" class="slide-btn" id="btn_next"></a>
            </div>
        </div>
        <!--end 产品幻灯片-->
        <div class="t_info plr20">
            <div class="name c3">${product.productName}</div>
            <div class="title">${product.productDescription}</div>
            <div class="pire c-cb1448 ptb10">${product.salePrice}</div>
        </div>
    </div>

    <!--star 选择-->
    <div class="b-ffffff mt10 plr20">
        <input id="productId" type="hidden" value="${product.productId}"/>
        <input id="shopId" type="hidden" value="${product.wxShopShopId}"/>
        <%--<div class="ptb10 opt_spec">--%>
            <%--<div class="item layout-box">--%>
                <%--<label>颜色：</label>--%>
                <%--<div class="box-col">--%>
                    <%--<span class="curr">玫瑰金</span>--%>
                    <%--<span>香槟金</span>--%>
                    <%--<span>星空银</span>--%>
                    <%--<span>星空银</span>--%>
                    <%--<span>星空银</span>--%>
                    <%--<span>星空银</span>--%>
                <%--</div>--%>
            <%--</div>--%>
            <%--<div class="item layout-box">--%>
                <%--<label>内存：</label>--%>
                <%--<div class="box-col">--%>
                    <%--<span>16G</span>--%>
                    <%--<span>64G</span>--%>
                    <%--<span>128G</span>--%>
                <%--</div>--%>
            <%--</div>--%>
        <%--</div>--%>
    </div>
    <!--end 选择-->

    <!--star 商品详情介绍参数售后-->
    <div class="b-ffffff mt10">
        <div class="tab_menu">
            <div class="mt layout-box tac">
                <span class="box-col">介绍</span>
                <span class="box-col">参数</span>
                <span class="box-col">售后</span>
            </div>
            <div class="mc b-f1f1f1 p20">
                <div class="item">
                    <img src="${ctx}/assets/public_skin/temp/temp_640276_001.png">
                    <img src="${ctx}/assets/public_skin/temp/temp_640276_002.png">
                    <img src="${ctx}/assets/public_skin/temp/temp_640276_003.png">
                </div>
                <div class="item">
                    2
                </div>
                <div class="item">
                    3
                </div>
            </div>
        </div>
    </div>
    <!--end 商品详情介绍参数售后-->

</article>
<!--star 底下购物按钮-->
<%--<div class="buy_height"></div>--%>
<%--<div class="bottom_buy layout-box tac">--%>
    <%--<a class="i_cart" href="${ctx}/shopping/myShoppingCart?sid=${shopId}"><i class="ico-60 ico_cart"></i>--%>
        <%--<c:if test="${cartNum>=0}">--%>
            <%--<s id="p_num">${cartNum}</s>--%>
        <%--</c:if>--%>
    <%--</a>--%>
    <%--<a class="i_buy_btn box-col" id="add_cart">加入购物车</a>--%>
    <%--<a class="i_buy_btn box-col" href="${ctx}/shopping/buyGoodsAtOnce?pid=${product.productId}">立即购买</a>--%>
<%--</div>--%>

<div class="buy_height"></div>
<div class="p_fotbtn layout-box tac">
    <c:if test="${isSeller==0}">
    <a class="i_cart b-ffffff odr_r" href="${ctx}/home"><i class="ico-60 ico_index"></i><p>主页</p></a>
    <a class="i_cart b-ffffff" href="${ctx}/shopping/myShoppingCart?sid=${shopId}"><i class="ico-60 ico_cart"></i><p>购物车</p>
        <c:if test="${cartNum>=0}">
            <s id="p_num">${cartNum}</s>
        </c:if>
    </a>
    <a class="b-ffaa3b cf box-col lh120" id="add_cart">加入购物车</a>
    <a class="b-ef2d2d cf box-col lh120" href="${ctx}/shopping/buyGoodsAtOnce?pid=${product.productId}">立即购买</a>
    </c:if>

    <c:if test="${isSeller==1}">
    <a class="i_cart b-ffffff odr_r" href="${ctx}/home"><i class="ico-60 ico_index"></i><p>主页</p></a>
    <a class="i_cart b-ffffff" href="#"><i class="ico-60 ico_cart"></i><p>购物车</p>
        <%--<c:if test="${cartNum>=0}">--%>
            <%--<s id="p_num">${cartNum}</s>--%>
        <%--</c:if>--%>
    </a>
    <a class="b-ffaa3b cf box-col lh120" href="#">加入购物车</a>
    <a class="b-ef2d2d cf box-col lh120" href="#">立即购买</a>
    </c:if>
</div>
<!--end 底下购物按钮-->
</body>
</html>
